package com.hippomeetsskunk.savanna.statistics;

public class RunningAverage {

	private final double decay;
	private double average;
	
	public RunningAverage(double decay){
		this.decay = decay;
		this.average = 0.0;
	}
	
	public void add(double d){
		average = average * decay + (1.0 - decay) * d;
	}
	
	public double average(){
		return average;
	}
}
